{% extends 'pybb/base.html' %}
{% load pybb_tags %}
{% load i18n %}

{% block pybb_title %}{{ topic }}{% endblock %}

{% block pybb_head_extra %}
    <script type="text/javascript" src="{{ PYBB_MEDIA_URL }}/js/pybbjs.js"></script>
{% endblock %}

{% block pybb_crumbs %}
<a href="/">AuAdult</a> <img src="/res/forum_v2/crumb.png" class="crumb-arrow" />
<a href="{% url pybb_index %}">Forum</a> <img src="/res/forum_v2/crumb.png" class="crumb-arrow" />
<a href="{{ topic.forum.category.get_absolute_url }}">{{ topic.forum.category }}</a> <img src="/res/forum_v2/crumb.png" class="crumb-arrow" />
<a href="{{ topic.forum.get_absolute_url }}">{{ topic.forum }}</a>
{% endblock %}

{% block pybb_content %}
<div class="topic-details">
  <h2>
    <a href="{{ topic.get_absolute_url }}">{{ topic }}</a>
  </h2>
</div>

{% with _('Posts') as label %}
{% include "pybb/pagination.html" %}
{% endwith %}


<ul class="post-list">
    {% if first_post and first_post != posts.0 %}
    {% with first_post as post %}
    <li class="first_post">
        {% include "pybb/_post_row.html" %}
    </li>
    {% endwith %}
    {% endif %}

    {% for post in posts %}
    <li class="">
        {% include "pybb/_post_row.html" %}
    </li>
    {% endfor %}
</ul>

{% with _('Posts') as label %}
{% include "pybb/pagination.html" %}
{% endwith %}

{% if user.is_authenticated %}
<!--
<div class="topic-control-bar">
{% if moderator %}
    {% if topic.sticky %}
    <a href="{% url pybb_topic_unstick topic.id %}">{% trans "Unstick topic" %}</a> /
    {% else %}
    <a href="{% url pybb_topic_stick topic.id %}">{% trans "Stick topic" %}</a> /
    {% endif %}

    {% if topic.closed %}
    <a href="{% url pybb_topic_open topic.id %}">{% trans "Open topic" %}</a> /
    {% else %}
    <a href="{% url pybb_topic_close topic.id %}">{% trans "Close topic" %}</a> /
    {% endif %}

    <a href="{% url pybb_topic_merge %}?topic={{ topic.id }}">{% trans 'Merge topics' %}</a> /
{% endif %}

    {% if subscribed %}
    <a href="{% url pybb_subscription_delete topic.id %}?from_topic">{% trans "Unsubscribe" %}</a>
    {% else %}
    <a href="{% url pybb_subscription_add topic.id %}">{% trans "Subscribe" %}</a>
    {% endif %}
</div>
{% endif %}
-->
{% if user.is_authenticated %}
 {% if not user.pybb_profile.is_banned %}
  {% if not topic.closed %}
   {% include "pybb/post_form.html" %}
  {% endif %}
 {% endif %}
{% endif %}

{% endblock %}
